<template>
  <div class="zlcBox">
      <div class="header">
        <div class="title">
            {{ $props.title }}
        </div>
      </div>
      <div :class="['body', $props.dataScroll ? 'scroll' : 'hidden']">
        <slot></slot>
      </div>
  </div>
</template>

<script>

export default {
    name: "zlcBox",
    props:{
      title:{
          type: String,
          default(){
              return '标题'
          }
      },
        dataScroll:{
          type: Boolean,
            default(){
              return false
            }
        }
    },
    setup(){

    }
}
</script>

<style scoped>
.zlcBox{
    width: 100%;
    height: 100%;
    .header{
        width: 100%;
        height: 34px;
        line-height: 34px;
        background: url("/src/assets/dwgk/标题框.png") center center no-repeat;
        background-size: 100% 100%;
        .title{
            padding-left: 20px;
            box-sizing: border-box;
            font-size: 22px;
            font-family: YouSheBiaoTiHei;
            font-weight: normal;
            font-style: italic;
            color: #F6F9FE;
            background: linear-gradient(180deg,rgba(14, 197, 236, 0.36) 5%, rgba(49, 190, 255, 0.36) 10%, #fff 60%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

    }
    .body{
        width: 100%;
        height: calc(100% - 34px);
        overflow: hidden;
    }
    .scroll{
        overflow-y: auto;
        &::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }

        /* 无内容时的滚动条样式 */
        &::-webkit-scrollbar-track {
            -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.2);
            border-radius: 2px;
            background: rgba(128, 164, 229, .5);
        }

        /* 有内容时的滚动条样式 */
        &::-webkit-scrollbar-thumb {
            background: rgba(79, 141, 255, 1);
            border-radius: 2px;
        }

        &::-webkit-scrollbar-thumb:hover {
            background: rgba(79, 141, 255, 1);
        }

        &::-webkit-scrollbar-corner {
            background: rgba(128, 164, 229, .5);
        }
    }
    .hidden{
        overflow-y: hidden;

    }
}
</style>
